summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCharles Lombardo <clombardo169@gmail.com>2023-09-22 22:51:48 +0200
committerCharles Lombardo <clombardo169@gmail.com>2023-09-22 22:51:48 +0200
commit5269a463999be77bedff2c8c3e4cf0ceedc6f631 (patch)
treed7d325e521d79806b446da4a1877b19b16894523
parentMerge pull request #11572 from t895/import-heuristic (diff)
downloadyuzu-5269a463999be77bedff2c8c3e4cf0ceedc6f631.tar
yuzu-5269a463999be77bedff2c8c3e4cf0ceedc6f631.tar.gz
yuzu-5269a463999be77bedff2c8c3e4cf0ceedc6f631.tar.bz2
yuzu-5269a463999be77bedff2c8c3e4cf0ceedc6f631.tar.lz
yuzu-5269a463999be77bedff2c8c3e4cf0ceedc6f631.tar.xz
yuzu-5269a463999be77bedff2c8c3e4cf0ceedc6f631.tar.zst
yuzu-5269a463999be77bedff2c8c3e4cf0ceedc6f631.zip
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/ui/main/MainActivity.kt11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/ui/main/MainActivity.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/ui/main/MainActivity.kt
index 54993a958..6fa847631 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/ui/main/MainActivity.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/ui/main/MainActivity.kt
@@ -50,6 +50,7 @@ import org.yuzu.yuzu_emu.model.TaskViewModel
import org.yuzu.yuzu_emu.utils.*
import java.io.BufferedInputStream
import java.io.BufferedOutputStream
+import java.io.FileInputStream
import java.io.FileOutputStream
import java.util.zip.ZipEntry
import java.util.zip.ZipInputStream
@@ -639,7 +640,15 @@ class MainActivity : AppCompatActivity(), ThemeProvider {
file.path.length
)
stream.putNextEntry(ZipEntry(newPath))
- stream.write(file.readBytes())
+
+ val buffer = ByteArray(8096)
+ var read: Int
+ FileInputStream(file).use { fis ->
+ while (fis.read(buffer).also { read = it } != -1) {
+ stream.write(buffer, 0, read)
+ }
+ }
+
stream.closeEntry()
}
}